package com.xxc.hs.funActivity.chart;

import android.text.TextUtils;

public class Message {
    public static final int TYPE_USER = 0;
    public static final int TYPE_AI = 1;

    private int type;
    private String content;
    private String textContent;
    private String imagePath;
    private boolean isImage;
    private boolean isLoading;

    public Message(int type, String content) {
        this.type = type;
        this.content = content;
        this.textContent = content;
        this.isImage = false;
        this.isLoading = false;
    }

    public Message(int type, String textContent, String imagePath, boolean isImage) {
        this.type = type;
        this.textContent = textContent;
        this.imagePath = imagePath;
        this.isImage = isImage;
        this.isLoading = false;

        // 组合内容
        if (isImage) {
            if (TextUtils.isEmpty(textContent)) {
                this.content = "[图片]";
            } else {
                this.content = textContent + "\n[图片]";
            }
        } else {
            this.content = textContent;
        }
    }

    public int getType() {
        return type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
        this.textContent = content;
    }

    public String getTextContent() {
        return textContent;
    }

    public String getImagePath() {
        return imagePath;
    }

    public boolean isImage() {
        return isImage;
    }

    public boolean isLoading() {
        return isLoading;
    }

    public void setLoading(boolean loading) {
        this.isLoading = loading;
    }
}